package top.mccat.common.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.mccat.common.core.domain.bk.BkBase;
import top.mccat.common.core.domain.bk.BkProductSale;
import top.mccat.common.core.domain.bk.BkSale;
import top.mccat.common.exception.bk.BaseItemNotFoundException;
import top.mccat.common.mapper.bk.BkBaseMapper;
import top.mccat.common.mapper.bk.BkProductSaleMapper;
import top.mccat.common.service.IBkProductSaleService;

/**
 * 销售商品连接表Service业务层处理
 * 
 * @author Raven
 * @date 2023-01-11
 */
@Service
public class BkProductSaleServiceImpl implements IBkProductSaleService 
{
    @Autowired
    private BkProductSaleMapper bkProductSaleMapper;

    @Autowired
    private BkBaseMapper bkBaseMapper;

    @Autowired
    private IBkProductSaleService bkProductSaleService;
    /**
     * 查询销售商品连接表
     * 
     * @param productId 销售商品连接表主键
     * @return 销售商品连接表
     */
    @Override
    public BkProductSale selectBkProductSaleByProductId(Integer productId)
    {
        return bkProductSaleMapper.selectBkProductSaleByProductId(productId);
    }

    /**
     * 查询销售商品连接表列表
     * 
     * @param bkProductSale 销售商品连接表
     * @return 销售商品连接表
     */
    @Override
    public List<BkProductSale> selectBkProductSaleList(BkProductSale bkProductSale)
    {
        return bkProductSaleMapper.selectBkProductSaleList(bkProductSale);
    }

    /**
     * 新增销售商品连接表
     * 
     * @param bkSale 销售商品连接表
     * @return 结果
     */
    @Override
    public int insertBkProductSale(BkSale bkSale)
    {
        return bkProductSaleMapper.insertBkProductSale(bkSale);
    }

    /**
     * 修改销售商品连接表
     * 
     * @param bkSale 销售商品连接表
     * @return 结果
     */
    @Override
    public int updateBkProductSale(BkSale bkSale)
    {
        return bkProductSaleMapper.updateBkProductSale(bkSale);
    }

    /**
     * 批量删除销售商品连接表
     * 
     * @param productIds 需要删除的销售商品连接表主键
     * @return 结果
     */
    @Override
    public int deleteBkProductSaleByProductIds(Integer[] productIds)
    {
        return bkProductSaleMapper.deleteBkProductSaleByProductIds(productIds);
    }

    /**
     * 删除销售商品连接表信息
     * 
     * @param productId 销售商品连接表主键
     * @return 结果
     */
    @Override
    public int deleteBkProductSaleByProductId(Integer productId)
    {
        return bkProductSaleMapper.deleteBkProductSaleByProductId(productId);
    }
}
